<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:NuSoft.ExpressionEditor">

    <Style TargetType="{x:Type local:ExpressionEditor}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:ExpressionEditor}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <TextBox x:Name="Result_PART" IsEnabled="False" Text="{Binding ParseResult, RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay,ValidatesOnDataErrors=True}"/>
                            <Grid x:Name="PropertyGrid_PART" Grid.Row="1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                            </Grid>
                            <Grid Grid.ColumnSpan="2" Grid.Column="1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <TextBox x:Name="ExpressionText_PART"  Text="{Binding ExpressionText, RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}"/>
                                <Button x:Name="EvaluateButton_PART" Grid.Column="1" Content="Evaluate"/>
                            </Grid>
                            <ListView x:Name="PropertiesList_PART" Grid.Row="1"  Grid.Column="1" ItemsSource="{TemplateBinding SourceProperties}">

                            </ListView>
                            <ListView x:Name="MethodsList_PART" Grid.Row="1" Grid.Column="2" ItemsSource="{TemplateBinding SupportedMethods}">
                                <ListView.ItemContainerStyle>
                                    <Style TargetType="ListViewItem">
                                        <Setter Property="ToolTip" Value="{Binding Hint}"/>
                                    </Style>
                                </ListView.ItemContainerStyle>
                                <ListView.ItemTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Display}"/>
                                    </DataTemplate>
                                </ListView.ItemTemplate>
                            </ListView>
                        </Grid>
                    </Border>
                    
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
